<?php
class randomImage extends Div
{
	function randomImage()
	{
		global $news;
        global $photo;
		$files = listFiles('uploaded');
		$len   = count($files);
		$ran   = rand(0,$len-1);
		$randomImage = $files[$ran];

        $menuData = $news->listLast(10);

		if ($menuData)
		{
			foreach ($menuData as $line => $info)
			{
				$result.=  "<b>" . $info['flags'] . '</b>-' . $info['title'].'<br/>';
			}
		}


        $data['imagePath'] = $randomImage;
        $data['imgMsg']    = $photo->getImageDescription($info['imgPath']) ;
        $data['news']      = $result;

        $html = getThemeContent('randomImage.html', $data);

		parent::div(null,$html);
	}
}
?>
